<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Home</title>

        <style type="text/css">
            #bungkus{ width: 960px; height: auto; margin: 0 auto;}
            .titles1{ width: 960px;  height: 45px;background-color: #ddd; color: #4F8B2C; list-style: none;}
            .emailbook{ margin-top: 5px; border: 1px solid #ddd; background: #fdfdfd; padding-left: 15px; padding-top: 10px; width: 960px; border-radius: 5px; height: 30px; font-size: 13px; color: #4d4d4d; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;}
            #elabels{ width: 385px; height: 25px; color: #4F8B2C; padding-bottom: 10px; padding-left: 15px;  padding-top: 15px; font-weight: 600;  margin-top: 5px;}
            td { width: 400px; }
            tr { border: 1px solid #000; }
        </style>

    </head>

    <body>
        <div id="bungkus">
            <?php
            $arr = $id_book = $this->uri->segment(3);
            $arr = explode('.', $arr);

            if (count($arr) == 1) {
                $alert = '';
            } else {
                $alert = 'confirm';
            }
            ?>

            <div id="blokreg">
                <div id="st"><center>Stasiuntiketonline.com</center></div>
                <div id="info">Informasi Booking</div>
                <?php foreach ($rows as $booking): ?>
                    <style type="text/css">
                        #st{ color: #CA0000; width: 960px;  margin-top: 5px; height: 50px; font-size: 50px; font-weight: 600;}
                        #id{ color: green; width: 950px; padding-left: 10px; border: 1px solid #ddd; margin-top: 40px; height: 50px; font-size: 40px; font-weight: 600;}
                        #info{color:#fff; width:950px; padding-top: 10px; background: #4F8B2C; padding-left: 10px;  height: 40px; font-size: 25px; font-weight: 900; margin-top: 20px;}

                    </style>
                    <div id="id"><?php echo get_user($booking->id_user) ?></div>

                <?php endforeach ?>

                <div class="titles1"><align="left"><div id="elabels">Booking Details</div></p></div>


                <table class="emailbook">
                    <?php foreach ($rows as $booking): ?>
                        <tbody> 

                            <tr>
                                <td>Mskapai:</td>
                                <td><?php echo $booking->airlines_name ?> <?php echo $booking->flight_number ?></td>
                            </tr>    
                            <tr>
                                <td>Total Price:</td>
                                <td><?php echo $booking->price_value ?></td>
                            </tr>    
                            <tr>
                                <td>From:</td>
                                <td><?php echo get_airport($booking->from) . " ($booking->from)" ?></td>
                            </tr>    
                            <tr>
                                <td>To:</td>
                                <td><?php echo get_airport($booking->to) . " ($booking->to)" ?></td>
                            </tr>    
                            <tr>
                                <td>Depart:</td>
                                <td>JAM <?php echo $booking->simple_departure_time ?> / <?php echo get_tanggal_1($booking->date) ?></td>
                            </tr>    
                            <tr>
                                <td>Arrive:</td>
                                <td>JAM <?php echo $booking->simple_arrival_time ?> / <?php echo get_tanggal_1($booking->date) ?></td>
                            </tr>    
                            <tr>
                                <td>Class:</td>
                                <td><?php echo $booking->class ?></td>
                            </tr>    
                            <tr>
                                <td>Adult:</td>
                                <td><?php echo $booking->adult ?></td>
                            </tr>
                            <tr>
                                <td>Child:</td>
                                <td><?php echo $booking->child ?></td>
                            </tr>
                            <tr>
                                <td>Infant:</td>
                                <td><?php echo $booking->infant ?></td>
                            </tr>
                            <tr>
                                <td>Keterangan:</td>
                                <td><?php echo $booking->keterangan ?></td>
                            </tr>
                            <tr>
                                <td>Status:</td>
                                <td><?php echo get_status_color($booking->status) ?></td>
                            </tr>
                        </tbody>
                    <?php endforeach; ?>
                </table>

                <div class="titles1"> <align="left"><div id="elabels">Penumpang <?php // echo $penumpang = $booking->adult + $booking->child + $booking->infant  ?></div></p></div>


                <table class="emailbook">
                    <?php $adults = get_booking_adult($booking->code) ?>

                    <?php $no = 1 ?>
                    <?php foreach ($adults as $adult): ?>
                        <tbody>
                            <tr>
                                <td><b>Dewasa <?php if (count($adults) > 1) { ?><font color="#4F8B2C"><?php echo $no ?><?php } ?></font>&nbsp;&nbsp;&nbsp;&nbsp;</b>
                                </td>
                                <td ></td>
                            </tr>
                            <tr>
                                <td>Nama Depan:</td>
                                <td><b><font color="#4F8B2C"><?php echo $adult->nama_depan ?></font></b></td>
                            </tr>
                            <tr>
                                <td>Nama Belakang:</td>
                                <td><b><font color="#4F8B2C"><?php echo $adult->nama_belakang ?></font></b></td>
                            </tr>
                            <tr>
                                <td>Passport:</td>
                                <td><?php echo $adult->passport ?></td>
                            </tr>
                            <tr>
                                <td>Identitas:</td>
                                <td><?php echo $adult->identitas ?></td>
                            </tr>
                            <tr>
                                <td><br></td>
                                <td></td>
                            </tr>
                        </tbody>
                        <?php $no++ ?>
                    <?php endforeach; ?>
                </table>

                <?php if ($booking->child > 0): ?>
                    <table class="emailbook">
                        <?php $childs = get_booking_child($booking->code) ?>
                        <?php $no = 1 ?>
                        <?php foreach ($childs as $child): ?>
                            <b>Anak <?php if (count($childs) > 1) { ?><?php echo $no ?><?php } ?></b>
                            <?php $no++ ?>
                            <tbody>
                                <tr>
                                    <td>Nama Depan:</td>
                                    <td><?php echo $child->title ?> <?php echo $child->nama_depan ?> </td>
                                </tr>
                                <tr>
                                    <td>Nama Belakang:</td>
                                    <td><?php echo $child->nama_belakang ?></td>
                                </tr>
                                <tr>
                                    <td>Tanggal Lahir:</td>
                                    <td><?php echo $child->tanggal . "-" . get_month($child->bulan) . "-" . $child->tahun ?></td>
                                </tr>
                            </tbody>
                        <?php endforeach; ?>
                    </table>
                <?php endif ?>

                <?php if ($booking->infant > 0): ?>
                    <table class="emailbook">
                        <?php $infants = get_booking_infant($booking->code) ?>
                        <?php $no = 1 ?>
                        <?php foreach ($infants as $infant): ?>
                            <b>Bayi <?php if (count($infants) > 1) { ?><?php echo $no ?><?php } ?></b>
                            <?php $no++ ?>
                            <tbody>
                                <tr>
                                    <td>Nama Depan:</td>
                                    <td><?php echo $infant->title ?> <?php echo $infant->nama_depan ?> </td>
                                </tr>
                                <tr>
                                    <td>Nama Belakang:</td>
                                    <td><?php echo $infant->nama_belakang ?></td>
                                </tr>
                                <tr>
                                    <td>Tanggal Lahir:</td>
                                    <td><?php echo $infant->tanggal . "-" . get_month($infant->bulan) . "-" . $infant->tahun ?></td>
                                </tr>
                                <tr>
                                    <td>Orang Tua:</td>
                                    <td><?php echo get_orangtua($infant->orangtua) ?></td>
                                </tr>
                            </tbody>
                        <?php endforeach; ?>
                    </table>
                <?php endif ?>


                <div class="titles1"><align="left"><div id="elabels">Data Kontak</div></p></div>

                <table class="emailbook">
                    <tbody> <?php foreach ($rows as $booking): ?>

                            <tr>
                                <td>Title Name:</td>
                                <td><b><font color="#4F8B2C"><?php echo $booking->title_dk ?> <?php echo $booking->nama_d_dk ?></font></b></td>
                            </tr>
                            <tr>
                                <td>Last Name:</td>
                                <td><?php echo $booking->nama_b_dk ?></td>
                            </tr>
                            <tr>
                                <td>Kode Negara:</td>
                                <td><?php echo $booking->kode_negara_dk ?></td>
                            </tr>
                            <tr>
                                <td>Kode Wilayah:</td>
                                <td><?php echo $booking->kode_wilayah_dk ?></td>
                            </tr>
                            <tr>
                                <td>No telephone:</td>
                                <td><?php echo $booking->nomor_telp_dk ?></td>
                            </tr>
                            <tr>
                                <td>Kode Negara:</td>
                                <td><?php echo $booking->kode_negara_s_dk ?></td>
                            </tr>
                            <tr>
                                <td>No Telephone Selular:</td>
                                <td><?php echo $booking->no_telp_selular_dk ?></td>
                            </tr>
                            <tr>
                                <td>Catatan:</td>
                                <td><?php echo $booking->catatan_dk ?></td>
                            </tr>
                            <tr>
                                <td>Booking Time:</td>
                                <td><?php echo date('H:i / d F Y', strtotime($booking->date_create)) ?></td>
                            </tr>
                            <tr>
                                <td>Code Booking:</td>
                                <td><?php echo $booking->code_booking ?> </td>
                            </tr>

                        <?php endforeach; ?>
                </table>
            </div>
        </div>
    </body>
</html>
